import {
	request,
	hotelRequest,
	otherRequest
} from '@/ygb/request';

export default {
	merchant: {
		getUserRoleByMobile: (data) =>
			request({
				baseURL: 'https://api-prod-xyh.jingxishenghuo1688.com/',
				url: `/user/api/team/getUserRoleByMobile/${data}`,
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		applyList: (params) =>
			otherRequest({
				url: '/operations/api/apply/list', //记得改回operations/api/apply/list
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 让利比例刷新
		getRefreshData: (id) =>
			otherRequest({
				url: `/operations/api/apply/update_status/${id}`, //记得改回operations/api/apply/list
				method: 'POST',
				custom: {
					showError: true,
				},
			}),
		getInviteInfo: (data) =>
			otherRequest({
				url: '/operations/api/getBdUserInfo',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		setBasicInformation: (data) =>
			otherRequest({
				url: `/operations/api/apply/updateStoreImg/${data.id}`,
				method: 'POST',
				data,
				custom: {
					loadingMsg: '提交中',
					showLoading: false,
					showError: false,
				},
			}),
		applyDetailTest: (id, params) =>
			otherRequest({
				url: `/operations/api/apply/detail/${id}`,
				method: 'GET',
				params,
				custom: {
					showLoading: true,
					showError: false,
				},
			}),
		queryBankList: (params) =>
			otherRequest({
				url: '/operations/api/apply/queryBank',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		getShopDetail: (data) =>
			otherRequest({
				url: '/operations/api/getShopInfo',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		storeTypeList: (params) =>
			otherRequest({
				url: '/index/storeCategory',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 微信实名查询
		surprise_real: (id) =>
			otherRequest({
				url: `/operations/api/apply/real/${id}`,
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		surprise_sign: (id) =>
			otherRequest({
				url: `/operations/api/apply/agreement/${id}`,
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		surprise_elec: (id) =>
			otherRequest({
				url: `/operations/api/apply/elecContractAccredit/${id}`,
				method: 'POST',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		mccList: (data) =>
			otherRequest({
				url: '/leshua/api/pay/mcc',
				method: 'GET',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		realNameSubmchQuery: (id, params) =>
			request({
				baseURL,
				url: `/operations/api/apply/realNameSubmchQuery/${id}`,
				method: 'GET',
				params,
				custom: {
					showLoading: true,
					showError: false,
				},
			}),
		getBankBranchList: (params) =>
			otherRequest({
				url: '/operations/api/apply/getBankBranchList',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		storeTypeName: (params) =>
			otherRequest({
				url: '/operations/api/apply/storeCateInfo',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		card_is_bind: (bd_no) =>
			hotelRequest({
				url: `/user/api/nfcBind/check/${bd_no}`,
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 绑定编号接口
		card_bind: (data) =>
			hotelRequest({
				url: '/user/api/nfcBind/bind',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		// 绑定上级
		bindParent: (data) =>
			hotelRequest({
				url: '/user/api/nfcBind/bindParent',
				method: 'POST',
				data,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
		applyEditNew: (
				data, //编辑入驻
			) =>
			otherRequest({
				url: `/operations/api/apply/edit_new/${data.id}`,
				method: 'POST',
				data,
				custom: {
					loadingMsg: '提交中',
					showLoading: false,
					showError: false,
				},
			}),
		// 入驻进件一个接口
		applyAddNew: (
				data, //新增入驻
			) =>
			otherRequest({
				url: '/operations/api/apply/add_new',
				method: 'POST',
				data,
				custom: {
					loadingMsg: '提交中',
					showLoading: false,
					showError: false,
				},
			}),
		getDefaultImg: (params) => {
			return request({
				url: '/shop/yb/shDefData',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			});
		},
		getBankList: (params) =>
			otherRequest({
				url: '/operations/api/getBankList',
				method: 'GET',
				params,
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
	},
	giveaway: {
		getUserInfo: () =>
			otherRequest({
				url: '/operations/api/apply/getUserInfo',
				method: 'GET',
				custom: {
					showLoading: false,
					showError: false,
				},
			}),
			cooperation: (params) =>
			  request({
			    baseURL,
			    url: '/shop/api/cooperation/crud',
			    method: 'GET',
			    params,
			    custom: {
			      showLoading: false,
			      showError: false,
			    },
			  }),
	},
	saveDiscount: (data, id) =>
	  otherRequest({
	    url: `/operations/api/apply/save_discount/${id}`,
	    method: 'POST',
	    data,
	    custom: {
	      showError: false,
	    },
	  }),
};